import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'

dayjs.extend(utc)

export function formatUTC(utcString: string, format = 'YYYY-MM-DD HH:mm:ss') {
  return dayjs.utc(utcString).utcOffset(8).format(format)
}

export function formatType(type:number){
  if(type == 1){
    return '模块'
  }else if(type ==2){
    return '菜单'
  }else if(type ==3){
    return '操作'
  }
}

export function formatPercent(percent:number){
  return percent/1000
}

export function formatUserStatus(status:number){
  if(status == 1){
    return '有效'
  }else if(status ==0){
    return '无效'
  }else if(status ==4){
    return '已注销'
  }
}

export function formatUserType(type:number){
  if(type ==0){
    return '普通成员'
  }else if(type==1){
    return '管理员'
  }else if(type==2){
    return '群主'
  }else{
    return '其他'
  }
}

export function feedbackType(type:number){
  if(type ==1){
    return '报告故障'
  }else if(type==2){
    return '产品功能建议'
  }else if(type==3){
    return '我要吐槽'
  }else{
    return '其他'
  }
}


export function groupStatus(status:number){
  if(status == 0){
    return '正常'
  }else if(status ==3){
    return '封禁'
  }
}

export function ownerStatus(status:number){
  if(status == 0){
    return '封禁'
  }else if(status ==1){
    return '正常'
  }else if(status==4){
    return '已注销'
  }
}

export function mRender(data:number){
   //1 存在反动与政治言论 2存在淫秽色情信息 3 存在赌博行为 4 存在欺诈骗钱行为 5 存在暴力血腥或涉恐内容 6 存在出售假冒伪劣商品行为
   if  (data == 1) {
    return "存在反动与政治言论";
  } else if (data ==2) {
      return "存在淫秽色情信息";
  } else if (data ==3) {
    return "存在赌博行为";
  }else if (data == 4) {
      return "存在欺诈骗钱行为";

  } else if (data ==5) {
      return "存在暴力血腥或涉恐内容";

  } else if (data == 6) {
      return "存在出售假冒伪劣商品行为";

  } else if (data == 7 ) {
      return "发布骚扰内容";

  }
}

export function appType(type:number){
  if (type == 1) {
    return "游戏";
} else if (type == 2) {
    return "图书";
} else if (type == 3) {
    return "抢购";
} else if (type == 4) {
    return "直播大厅";
}  else if (type == 5) {
    return "直播房间";
}else if (type == 6) {
    return "小视频";
}else if (type == 9) {
    return "兴趣部落";
}else if (type == 10) {
    return "微团购";
}else{
  return '未知'
}
}

export function reachType(status:number){
  if(status == 0){
    return '全部用户'
  }else if(status ==1){
    return '部分用户'
  }else if(status==4){
    return '批量用户'
  }
}



